ASP. NET Core Web API minimizes project and coreapi
The default ASP. NET Core template in ASP. NET Core contains a Web API template to create a Web API project.
Sometimes, you only need to create an API and do not need to care about Razor, localization or XML serialization. By deleting useless NuGet software packages and code, you can increase the API loading time and reduce the deployment package size.
Create a project
Open VS2017 and create an ASP. NET Core application (. NET Core) project nam
In Visudio Studio, the new ASP. NET core can have built-in application Insights. Application insights can help us to apply the performance of the Web application so that we optimize our application, this is step by step.Code-side
new ASP. NET Core project (ASP. NET Core 1.1 version) 650) this.width=650; "title=" Ai1.png "src=" http://s2.51cto.com/wyfs02/M02/8D/59/ Wkiom1iyfnrqdo-haalyulkw9rq031.png-wh_500x0-wm_3-wmp_4-s_2140599624.png "alt=" Wkiom1iyfnrqdo-haalyulkw9rq031.png-wh_50 "/>
"Selfless sharing: ASP. NET CORE Project Combat" Catalog IndexBrief introductionIn our previous ASP. NET MVC development, when it comes to configuration files, we don't think of web. config and App. Config, in the core we see a lot of changes, the new configuration system appears to be more lightweight, has better extensibility, and supports a variety of data sources.Blog Park for this explanation a lot, such as: Artche, but, there is no point to see the old a blog or some difficult, for the old
and display the error page, then:. Capturestartuperrors (true)Whether you should listen to Microsoft.AspNetCore.Hosting.Server.IServer-developed URLs (IPv4, V6, hostname, localhost, UNIX sockets), you can use:. Preferhostingurls (true)Listen for the specified URL:. Useurls ("http://0.0.0.0:5000")Using applicationinsights:. Useapplicationinsights ()Startup.csStartup is used to pre-load/configure services and middleware.The Configureservices method is
// The UserExtension is referenced here.@ Using MySqlDemo. ViewModels @ addTagHelper *, Microsoft. AspNetCore. Mvc. TagHelpers @ inject Microsoft. ApplicationInsights. Extensibility. TelemetryConfiguration
In this way, you can directly use User. GetAccountID () to obtain the User ID.
You can use or use Roles to determine the role to log on, but the string must be exactly the same. This does not support the determination that the user has multiple Ro
1.1; Proxy_set_header Upgrade $http _upgrade; Proxy_set_header Connection keep-alive; Proxy_set_header Host $host; Proxy_cache_bypass $http _upgrade; }
Start Nginx
sudo systemctl start nginx
Here, our environment is well matched, and then we'll publish Zkeacms
Release Zkeacms. Core
Release Zkeacms. The Core is relatively simple, double-click Publish.cmd
Database SQLite
For the sake of simplicity, here SQLite is used as a database to generate a SQLite data named Database.sqlite. Under the p
420section Ⅱ. NET Core with Windows17th Visual Studio 2015 45818th Chapter. NET Compiler Platform 507Chapter 19th Test 53820th Diagnostics and Applicationinsights 566Chapter 21st task and parallel programming 590Chapter 22nd Task Synchronization 612Chapter 23rd file and Stream 643Chapter 24th Security 685The 25th Chapter Network 70826th Chapter Composition 754The 27th Chapter XML and JSON 78728th Localization 829section Ⅲ Windows applicationsChapter
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.